#include "pch.h"

using std::set;

void ZobristCutoff::cutoff(const Board & board, int to_play, int out[200]) {
	long long hash = Zobrist::getIns()->hash(board);
	int size = board.s();
	set<long long> h;

	for (int i = 0; i < size; i++) {
		for (int j = 0; j < size; j++) {
			if (board.get(i, j) == 0) {
				long long new_hash = Zobrist::getIns()->update(board, hash, i, j, to_play);
				if (h.find(new_hash) == h.end()) {
					h.insert(new_hash);
				}
				else {
					out[i * size + j] = 1;
				}
			}
		}
	}
}